import { Component, EventEmitter, Output } from '@angular/core';
import { PiplineConifg } from 'src/components/scenarios/models';

@Component({
  selector: 'app-pipline-setting',
  templateUrl: './pipline-setting.component.html',
  styleUrl: './pipline-setting.component.scss'
})
export class PiplineSettingComponent {
  sidebarVisible: boolean = false;
  cfg?: PiplineConifg;
  @Output()
  onHide: EventEmitter<PiplineConifg> = new EventEmitter();

  onEdit(cfg: PiplineConifg) {
    if (cfg) {
      this.cfg = { ...cfg };
      this.sidebarVisible = true;
    }
  }
  onSidebarHide() {
    this.onHide.next(this.cfg!);
    this.cfg = undefined;
  }
}
